<template>
	<view class="bizhidiv" @click.stop="goUrl" :style="{backgroundImage: 'url(' + mybjimg + ')'}">

		<view class="djstime">
			<view class="miao1">
				<u-count-to :start-val="5" :end-val="0" :duration="5000" :useEasing="false" color="#fff" fontSize="30"
					:bold="false"></u-count-to>
			</view>
			<view class="miao2">
				S
			</view>
		</view>
		<view class="tansuo" @click.stop="bjimgshow">
			立即探索
		</view>
	</view>
</template>

<script>
	var timer;
	export default {
		data() {
			return {
				mybjimg: '',
				lkts: true,
				info:[]
			}
		},

		onLoad(options) {
			this.getbizhi();
			// 获取设备品牌、型号、设备 id 、系统名称、osVersion
			//const {deviceBrand, deviceModel, deviceId, osName, osVersion} = uni.getSystemInfoSync();

			// console.log('111111111111111111',deviceBrand, deviceModel, deviceId, osName, osVersion)
			// wx.getSystemInfoAsync({
			//   success (res) {

			//     console.log('5646546456',res)

			//   }
			// })
			let that = this;


			timer = setTimeout(function() {
				that.$navTo.reLaunch({
					url: "/pages/index/index",
				});
			}, 5000);

		},
		methods: {
			bjimgshow() {
				// uni.setStorage({
				// 	key: 'shouye_key',
				// 	data: {
				// 		lkts: false
				// 	},
				// 	success: function() {
				// 		console.log('success');
				// 	}
				// });

				clearTimeout(timer);
				this.$navTo.reLaunch({
					url: "/pages/index/index",
				});
			},
			goUrl(){
				
				if(this.info.linkUrl){
					clearTimeout(timer)
					if(this.info.linkType == 1){
						uni.navigateTo({
							url: '/pages/index/webview?url='+encodeURIComponent(this.info.linkUrl)
						})
					}else{
						uni.navigateTo({
							url: this.info.linkUrl
						})
					}
				}
				
			},
			getbizhi() {
				this.$api.get('/api/isWallpaper/getActive', {

				}).then(res => {
					//  console.log('res.data',res.data)
					if (res.data.code == 0) {
						
						if (!res.data.data) {
							this.mybjimg =
								'https://i.ringzle.com/file/20240103/e3c22dd2aacd467b9843d55a488c99b3.png';
						} else {
							this.info = res.data.data
							this.mybjimg = res.data.data.url;
							//  console.log('111111111111111111',this.mybjimg)
						}
					} else {

					}
				})
			},


		}
	}
</script>

<style>
	.miao1 {
		height: 48rpx;
		width: 44rpx;
		/*  background-color: rgba(0, 0, 0, 0.4); */
		/* border-radius: 50%; */
		display: flex;
		align-items: center;
		justify-content: flex-end;
	}

	.miao2 {
		height: 48rpx;
		width: 44rpx;
		line-height: 50rpx;
		color: #fff;
		font-size: 27rpx;
		padding-left: 5rpx;
	}

	.djstime {
		width: 88rpx;
		height: 48rpx;
		border-radius: 24px;
		border: 1px solid #FFFFFF;
		margin-left: 50rpx;
		/* 	background-color: rgba(0, 0, 0, 0.4); */
		margin-top: 130rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.mymap {
		width: 100%;
		height: calc(100vh - 45px);
	}

	.bizhidiv {
		width: 750rpx;
		height: 100%;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		// background-image: url('https://i.ringzle.com/file/20240103/d68614a7e0f44e6a884042dbcbe2747b.png');
		background-size: 100% 100%;
		//background: #0089ff;
		z-index: 999;
	}

	.tansuo {
		width: 300rpx;
		height: 80rpx;
		text-align: center;
		margin: 65vh auto 0 auto;
		color: #fff;
		border: 1px solid #fff;
		border-radius: 20rpx;
		line-height: 80rpx;
		font-weight: bold;
		//	background-image: linear-gradient(to right, #f44336, #2B65EC, #6960EC, #4caf50);
		background-color: rgba(0, 0, 0, 0.4);
		transition: background-position 0.3s;
		box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
	}
</style>